<?php 
 $url=$_POST['url'];
 $param=isset($_POST['param'])?$_POST['param']:'';
 $ch=curl_init();
 $_headers = array('Expect:');
 array_push($_headers, "X-Requested-With:XMLHttpRequest");
 curl_setopt($ch, CURLOPT_HTTPHEADER,$_headers);
 if($_POST['type']=='GET'){  
	 if($param !=''){	  
		 if(strpos($url,'?')){
			 $url=$url.'&'.http_build_query($param);
		 }else{
			 $url=$url.'?'.http_build_query($param);
		 }
	 }
     curl_setopt($ch,CURLOPT_URL,$url);    
     curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch,CURLOPT_HEADER, 0);
 }else{ 
     curl_setopt($ch,CURLOPT_URL,$url);
     curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
     curl_setopt($ch,CURLOPT_POST,1);
     curl_setopt($ch,CURLOPT_POSTFIELDS,$param);        
 }
 $output =curl_exec($ch);
 curl_close($ch); 
 echo   $output;die; 
?>
